package com.Modular.pdf_Util.examplesPDF.CheLiangSanChaJiLu;

import com.jfinal.core.Controller;
import com.jfinal.kit.Kv;


/**
 * 车辆三检记录
 */
public class CheLiangSanChaJiLuControlle extends Controller {

    public void buildPdf() {
        String chePaiHaoMa = getPara("chePaiHaoMa");//chePaiHaoMa
        String time = getPara("time");//time 格式：2021-04-25

        try {
            String buildUrl = CheLiangSanChaJiLuService.service.buildPdf(chePaiHaoMa,time);

            Kv dataMap = Kv.create().set("WenJianURL", buildUrl);

            renderJson(Kv.create().set("code", 200).set("data", dataMap).set("msg", "成功"));
        } catch (Exception e) {
            renderJson(Kv.create().set("code", 500).set("data", e).set("msg", "生成pdf出错"));
        }
    }
}
